package com.niknik.woody.utils.cards;

/**
 * User: yoda
 * Date: 15.02.11
 * Time: 17:36
 */
// TODO: fix all warnings
// TODO: 100% JUnit coverage
public class Card {

  private final CardSuit _suit;
  private final CardVolume _volume;
  private final String _value;

  private Card(CardSuit suit, CardVolume volume) {
    _suit = suit;
    _volume = volume;
    _value = volume.toString() + suit.toString();
  }

  public CardVolume getVolume() {
    return _volume;
  }

  public CardSuit getSuit() {
    return _suit;
  }

  @Override
  public String toString() {
    return _value;
  }

  public static final Card[] DECK = {new Card(CardSuit.SPADES, CardVolume._2), new Card(CardSuit.SPADES, CardVolume._3),
      new Card(CardSuit.SPADES, CardVolume._4), new Card(CardSuit.SPADES, CardVolume._5), new Card(CardSuit.SPADES,
      CardVolume._6), new Card(CardSuit.SPADES, CardVolume._7), new Card(CardSuit.SPADES, CardVolume._8), new Card(
      CardSuit.SPADES, CardVolume._9), new Card(CardSuit.SPADES, CardVolume._10), new Card(CardSuit.SPADES,
      CardVolume.J), new Card(CardSuit.SPADES, CardVolume.Q), new Card(CardSuit.SPADES, CardVolume.K), new Card(
      CardSuit.SPADES, CardVolume.A),

      new Card(CardSuit.CLUBS, CardVolume._2), new Card(CardSuit.CLUBS, CardVolume._3), new Card(CardSuit.CLUBS,
      CardVolume._4), new Card(CardSuit.CLUBS, CardVolume._5), new Card(CardSuit.CLUBS, CardVolume._6), new Card(
      CardSuit.CLUBS, CardVolume._7), new Card(CardSuit.CLUBS, CardVolume._8), new Card(CardSuit.CLUBS, CardVolume._9),
      new Card(CardSuit.CLUBS, CardVolume._10), new Card(CardSuit.CLUBS, CardVolume.J), new Card(CardSuit.CLUBS,
      CardVolume.Q), new Card(CardSuit.CLUBS, CardVolume.K), new Card(CardSuit.CLUBS, CardVolume.A),

      new Card(CardSuit.DIAMONDS, CardVolume._2), new Card(CardSuit.DIAMONDS, CardVolume._3), new Card(
      CardSuit.DIAMONDS, CardVolume._4), new Card(CardSuit.DIAMONDS, CardVolume._5), new Card(CardSuit.DIAMONDS,
      CardVolume._6), new Card(CardSuit.DIAMONDS, CardVolume._7), new Card(CardSuit.DIAMONDS, CardVolume._8), new Card(
      CardSuit.DIAMONDS, CardVolume._9), new Card(CardSuit.DIAMONDS, CardVolume._10), new Card(CardSuit.DIAMONDS,
      CardVolume.J), new Card(CardSuit.DIAMONDS, CardVolume.Q), new Card(CardSuit.DIAMONDS, CardVolume.K), new Card(
      CardSuit.DIAMONDS, CardVolume.A),

      new Card(CardSuit.HEARTS, CardVolume._2), new Card(CardSuit.HEARTS, CardVolume._3), new Card(CardSuit.HEARTS,
      CardVolume._4), new Card(CardSuit.HEARTS, CardVolume._5), new Card(CardSuit.HEARTS, CardVolume._6), new Card(
      CardSuit.HEARTS, CardVolume._7), new Card(CardSuit.HEARTS, CardVolume._8), new Card(CardSuit.HEARTS,
      CardVolume._9), new Card(CardSuit.HEARTS, CardVolume._10), new Card(CardSuit.HEARTS, CardVolume.J), new Card(
      CardSuit.HEARTS, CardVolume.Q), new Card(CardSuit.HEARTS, CardVolume.K), new Card(CardSuit.HEARTS, CardVolume.A),

      new Card(CardSuit.NONE, CardVolume.JOKER),};

}
